<?php

class Application_Form_GensetSummaryForm extends Zend_Form
{
    private function statusPemeriksaan()
    {
        $status = new Application_Model_Statusoperasi();
        $status = $status->getStatus();
        $stat = array();
        foreach($status as $status)
        {
            $stat[$status->id_status] = $status->status_operation;
        }
        return $stat;
    }
    
    private function waktuPemeriksaan()
    {
        $waktu = new Application_Model_Waktupemeriksaan();
        $waktu = $waktu->getWaktu();
        $wak = array();
        foreach ($waktu as $waktu)
        {
            $wak[$waktu->id_waktu_pemeriksaan] = $waktu->waktu_pemeriksaan;
        }
        
        return $wak;
    }


    public function init()
    {
        $serial_number = new Zend_Form_Element_Text('serial_number_genset');
        $serial_number->setLabel('Serial Number Genset')->setAttrib('disabled', true);
        
        $waktu_pemeriksaan = new Zend_Form_Element_Select('id_waktu_pemeriksaan');
        $waktu_pemeriksaan->setLabel('Waktu Pemeriksaan')->setMultiOptions($this->waktuPemeriksaan());
        
        $jam_operasi = new Zend_Form_Element_Text('jam_operasi');
        $jam_operasi->setLabel('Operation Time');
        
        $status_operasi = new Zend_Form_Element_Select('id_status');
        $status_operasi->setLabel('Operation Status')->setMultiOptions($this->statusPemeriksaan());
        
        $this->addElements(array($serial_number, $waktu_pemeriksaan, $jam_operasi, $status_operasi));
    }


}

